package com.ruoyi.mdm.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mdm.mapper.SkuMergeMasterSubMapper;
import com.ruoyi.mdm.domain.SkuMergeMasterSub;
import com.ruoyi.mdm.service.ISkuMergeMasterSubService;

/**
 * skum子Service业务层处理
 *
 * @author shiseido
 * @date 2025-03-01
 */
@Service
public class SkuMergeMasterSubServiceImpl implements ISkuMergeMasterSubService {
    @Autowired
    private SkuMergeMasterSubMapper skuMergeMasterSubMapper;

    /**
     * 查询skum子
     *
     * @param id skum子主键
     * @return skum子
     */
    @Override
    public SkuMergeMasterSub selectSkuMergeMasterSubById(Long id) {
        return skuMergeMasterSubMapper.selectSkuMergeMasterSubById(id);
    }

    /**
     * 查询skum子列表
     *
     * @param skuMergeMasterSub skum子
     * @return skum子
     */
    @Override
    public List<SkuMergeMasterSub> selectSkuMergeMasterSubList(SkuMergeMasterSub skuMergeMasterSub) {
        return skuMergeMasterSubMapper.selectSkuMergeMasterSubList(skuMergeMasterSub);
    }

    /**
     * 新增skum子
     *
     * @param skuMergeMasterSub skum子
     * @return 结果
     */
    @Override
    public int insertSkuMergeMasterSub(SkuMergeMasterSub skuMergeMasterSub) {
        skuMergeMasterSub.setCreateTime(DateUtils.getNowDate());
        return skuMergeMasterSubMapper.insertSkuMergeMasterSub(skuMergeMasterSub);
    }

    /**
     * 修改skum子
     *
     * @param skuMergeMasterSub skum子
     * @return 结果
     */
    @Override
    public int updateSkuMergeMasterSub(SkuMergeMasterSub skuMergeMasterSub) {
        skuMergeMasterSub.setUpdateTime(DateUtils.getNowDate());
        return skuMergeMasterSubMapper.updateSkuMergeMasterSub(skuMergeMasterSub);
    }

    /**
     * 批量删除skum子
     *
     * @param ids 需要删除的skum子主键
     * @return 结果
     */
    @Override
    public int deleteSkuMergeMasterSubByIds(Long[] ids) {
        return skuMergeMasterSubMapper.deleteSkuMergeMasterSubByIds(ids);
    }

    /**
     * 删除skum子信息
     *
     * @param id skum子主键
     * @return 结果
     */
    @Override
    public int deleteSkuMergeMasterSubById(Long id) {
        return skuMergeMasterSubMapper.deleteSkuMergeMasterSubById(id);
    }
}
